package com.qf.openapi.web.master.service;

import com.qf.openapi.web.master.entity.User;
import com.qf.openapi.web.master.exception.UserException;
import com.qf.openapi.web.master.vo.ResultVo;
import com.qf.openapi.web.master.vo.TableVo;
import com.qf.openapi.web.master.vo.UserRegistVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Date;
import java.util.List;

public interface UserService {
    public User getUserById(@Param("id") Integer id);

    public User getUserByName(@Param("name") String username);

    /**
     * 用户登陆功能，判断用户名密码是否正确
     *
     * @param username
     * @param password
     * @return 返回的user对象不为空，代表登陆成功
     */
    User login(String username, String password);

    boolean addUser(UserRegistVo user, MultipartFile file) throws IOException;

    TableVo selectAll(Integer page, Integer limit, String name, String sex, String birthday);

    boolean insertUser(UserRegistVo userRegistVo) throws UserException;

    boolean deleteUser(@Param("id") Integer[] ids);

    boolean updateUser(UserRegistVo userRegistVo) throws UserException;

    String export();

    void getListUser(MultipartFile file) throws IOException;
}
